<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="stylesheet" type="text/css" href="/static/bootstrap-3.3.7/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="/static/dataTables.bootstrap.css" />
<link rel="stylesheet" type="text/css" href="/static/rbf.css" />
<title>Router Information</title>
</head>
<body>

<header class="navbar navbar-inverse bs-docs-nav" role="banner">
<div class="container">
  <div class="navbar-header">
    <div class="navbar-brand">Hadoop</div>
  </div>

  <ul class="nav navbar-nav" id="ui-tabs">
    <li><a href="#tab-overview">Overview</a></li>
    <li><a href="#tab-namenode">Subclusters</a></li>
    <li><a href="#tab-router">Routers</a></li>
    <li><a href="#tab-datanode">Datanodes</a></li>
    <li><a href="#tab-mounttable">Mount table</a></li>
    <li class="dropdown">
      <a href="#" class="dropdown-toggle" data-toggle="dropdown">Utilities <b class="caret"></b></a>
      <ul class="dropdown-menu">
        <li><a href="jmx">Metrics</a></li>
        <li><a href="conf">Configuration</a></li>
        <li><a href="logs">Logs</a></li>
      </ul>
    </li>
  </ul>
</div>
</header>

<div class="container">

<div id="alert-panel">
  <div class="alert alert-danger">
    <button type="button" class="close" onclick="$('#alert-panel').hide();">&times;</button>
    <div class="alert-body" id="alert-panel-body"></div>
  </div>
</div>

<div class="tab-content">
  <div class="tab-pane" id="tab-overview"></div>
  <div class="tab-pane" id="tab-namenode"></div>
  <div class="tab-pane" id="tab-router"></div>
  <div class="tab-pane" id="tab-datanode"></div>
  <div class="tab-pane" id="tab-mounttable"></div>
</div>

<div class="row">
  <hr />
  <div class="col-xs-2"><p>Hadoop, {release-year-token}.</p></div>
</div>
</div>

<!-- Overview -->
<script type="text/x-dust-template" id="tmpl-federationhealth">
<div class="page-header"><h1>Router {#federation}<small>'{HostAndPort}'</small>{/federation}</h1></div>
{#federation}
<table class="table table-bordered table-striped">
  <tr><th>Started:</th><td>{RouterStarted}</td></tr>
  <tr><th>Version:</th><td>{Version}</td></tr>
  <tr><th>Compiled:</th><td>{CompileInfo}</td></tr>
  <tr><th>Cluster ID:</th><td>{ClusterId}</td></tr>
  <tr><th>Block Pool ID:</th><td>{BlockPoolId}</td></tr>
  <tr><th>Status:</th><td>{RouterStatus}</td></tr>
</table>
{/federation}

<div class="page-header"><h1>Summary</h1></div>
{#federation}
<p>
  Security is {#routerstat}{#SecurityEnabled}on{:else}off{/SecurityEnabled}{/routerstat}.</p>
<p>{#router}{#Safemode}{.}{:else}Safemode is off.{/Safemode}{/router}</p>

<p>
  {NumFiles|fmt_number} files and directories, {NumBlocks|fmt_number} blocks.
</p>

{#mem.HeapMemoryUsage}
<p>Heap Memory used {used|fmt_bytes} of {committed|fmt_bytes} Heap Memory. Max Heap Memory is {@eq key=max value="-1" type="number"}&ltunbounded&gt{:else}{max|fmt_bytes}{/eq}.</p>
{/mem.HeapMemoryUsage}

{#mem.NonHeapMemoryUsage}
<p>Non Heap Memory used {used|fmt_bytes} of {committed|fmt_bytes} Commited Non Heap Memory. Max Non Heap Memory is {@eq key=max value="-1" type="number"}&ltunbounded&gt{:else}{max|fmt_bytes}{/eq}.</p>
{/mem.NonHeapMemoryUsage}
<table class="table table-bordered table-striped">
  <tr><th>Total capacity</th><td>{TotalCapacity|fmt_bytes}</td></tr>
  <tr><th>Used capacity</th><td>{UsedCapacity|fmt_bytes}</td></tr>
  <tr><th>Remaining capacity</th><td>{RemainingCapacity|fmt_bytes}</td></tr>
  <tr><th>Nameservices</th><td>{NumNameservices}</td></tr>
  <tr><th>Namenodes</th><td>{NumNamenodes}</td></tr>
  <tr>
    <th>DataNodes usages% (Min/Median/Max/stdDev)</th>
    <td>{#NodeUsage.nodeUsage}{min} / {median} / {max} / {stdDev}{/NodeUsage.nodeUsage}</td>
  </tr>
  <tr><th><a href="#tab-datanode">Live Nodes</a></th><td>{NumLiveNodes} (Decommissioned: {NumDecomLiveNodes})</td></tr>
  <tr><th><a href="#tab-datanode">Dead Nodes</a></th><td>{NumDeadNodes} (Decommissioned: {NumDecomDeadNodes})</td></tr>
  <tr><th><a href="#tab-datanode">Decommissioning Nodes</a></th><td>{NumDecommissioningNodes}</td></tr>
  <tr><th title="Excludes missing blocks.">Number of Under-Replicated Blocks</th><td>{NumOfBlocksUnderReplicated}</td></tr>
  <tr><th>Number of Blocks Pending Deletion</th><td>{NumOfBlocksPendingDeletion}</td></tr>
</table>
{/federation}
</script>

<!-- Subclusters info: list of nameservices and namenodes -->
<script type="text/x-dust-template" id="tmpl-namenode">
<div class="page-header"><h1>Nameservice Information</h1></div>
<div>
  <ul class="federationhealth-namenode-legend">
    <li class="federationhealth-namenode-icon federationhealth-namenode-active">Active</li>
    <li class="federationhealth-namenode-icon federationhealth-namenode-standby">Standby</li>
    <li class="federationhealth-namenode-icon federationhealth-namenode-safemode">Safe mode</li>
    <li class="federationhealth-namenode-icon federationhealth-namenode-disabled">Disabled</li>
    <li class="federationhealth-namenode-icon federationhealth-namenode-unavailable">Unavailable</li>
  </ul>
</div>
<small>
<table class="table">
  <thead>
    <tr>
      <th colspan="6"></th>
      <th colspan="3">Blocks</th>
      <th colspan="2">Nodes</th>
      <th colspan="3">Decom</th>
    </tr>
    <tr>
      <th></th>
      <th>Nameservice</th>
      <th>Namenode</th>
      <th>Last Contact</th>
      <th>Capacity</th>
      <th>Files</th>
      <th>Total</th>
      <th>Missing</th>
      <th>Under-Replicated</th>
      <th>Live</th>
      <th>Dead</th>
      <th>Progress</th>
      <th>Live</th>
      <th>Dead</th>
    </tr>
  </thead>
  <tbody>
    {#Nameservices}
    <tr>
      <td class="federationhealth-namenode-icon federationhealth-namenode-{iconState}" title="{title}"></td>
      <td><a href="http://{webAddress}">{nameserviceId}</a></td>
      <td><a href="http://{webAddress}">{namenodeId}</a></td>
      <td>{lastHeartbeat}</td>
      <td ng-value="{usedPercentage}" style="width:210px">
        <div>
          <div style="display:inline-block; float: left; padding-right: 10px; width:60px;">{totalSpace|fmt_bytes}</div>
          <div class="clearfix progress federationhealth-namenode-capacity-bar" title="Used: {used|fmt_bytes}">
            <div class="progress-bar {#helper_usage_bar value="{usedPercentage}"/}" style="width: {usedPercentage}%">
            </div>
          </div>
        </div>
      </td>
      <td>{numOfFiles}</td>
      <td>{numOfBlocks}</td>
      <td>{numOfBlocksMissing}</td>
      <td>{numOfBlocksUnderReplicated}</td>
      <td>{numOfActiveDatanodes}</td>
      <td>{numOfDeadDatanodes}</td>
      <td>{numOfDecommissioningDatanodes}</td>
      <td>{numOfDecomActiveDatanodes}</td>
      <td>{numOfDecomDeadDatanodes}</td>
    </tr>
    {/Nameservices}
  </tbody>
</table>
</small>

<div class="page-header"><h1>Namenode Information</h1></div>
<div>
  <ul class="federationhealth-namenode-legend">
    <li class="federationhealth-namenode-icon federationhealth-namenode-active">Active</li>
    <li class="federationhealth-namenode-icon federationhealth-namenode-standby">Standby</li>
    <li class="federationhealth-namenode-icon federationhealth-namenode-safemode">Safe mode</li>
    <li class="federationhealth-namenode-icon federationhealth-namenode-unavailable">Unavailable</li>
  </ul>
</div>
<small>
<table class="table">
  <thead>
    <tr>
      <th colspan="7"></th>
      <th colspan="3">Blocks</th>
      <th colspan="2">Nodes</th>
      <th colspan="3">Decom</th>
    </tr>
    <tr>
      <th></th>
      <th colspan="2">Namenode</th>
      <th>Web address</th>
      <th>Last Contact</th>
      <th>Capacity</th>
      <th>Files</th>
      <th>Total</th>
      <th>Missing</th>
      <th>Under-Replicated</th>
      <th>Live</th>
      <th>Dead</th>
      <th>Progress</th>
      <th>Live</th>
      <th>Dead</th>
    </tr>
  </thead>
  <tbody>
    {#Namenodes}
    <tr>
      <td class="federationhealth-namenode-icon federationhealth-namenode-{iconState}" title="{title}"></td>
      <td>{nameserviceId}</td>
      <td>{namenodeId}</td>
      <td><a href="http://{webAddress}">{webAddress}</a></td>
      <td>{lastHeartbeat}</td>
      <td ng-value="{usedPercentage}" style="width:210px">
        <div>
          <div style="display:inline-block; float: left; padding-right: 10px; width:60px;">{totalSpace|fmt_bytes}</div>
          <div class="clearfix progress federationhealth-namenode-capacity-bar" title="Used: {used|fmt_bytes}">
            <div class="progress-bar {#helper_usage_bar value="{usedPercentage}"/}" style="width: {usedPercentage}%">
            </div>
          </div>
        </div>
      </td>
      <td>{numOfFiles}</td>
      <td>{numOfBlocks}</td>
      <td>{numOfBlocksMissing}</td>
      <td>{numOfBlocksUnderReplicated}</td>
      <td>{numOfActiveDatanodes}</td>
      <td>{numOfDeadDatanodes}</td>
      <td>{numOfDecommissioningDatanodes}</td>
      <td>{numOfDecomActiveDatanodes}</td>
      <td>{numOfDecomDeadDatanodes}</td>
    </tr>
    {/Namenodes}
  </tbody>
</table>
</small>
</script>

<!-- Routers -->
<script type="text/x-dust-template" id="tmpl-router">
<div class="page-header"><h1>Routers Information</h1></div>
<div>
  <ul class="federationhealth-router-legend">
    <li class="federationhealth-router-icon federationhealth-router-active">Active</li>
    <li class="federationhealth-router-icon federationhealth-router-safemode">Safe mode</li>
    <li class="federationhealth-router-icon federationhealth-router-unavailable">Unavailable</li>
  </ul>
</div>
<table class="table">
  <thead>
    <tr>
      <th colspan="4"></th>
      <th colspan="2">Last update</th>
      <th></th>
    </tr>
    <tr>
      <th></th>
      <th>Address</th>
      <th>Status</th>
      <th>Heartbeat</th>
      <th>Membership</th>
      <th>Mount table</th>
      <th>Version</th>
    </tr>
  </thead>
  <tbody>
    {#Routers}
    <tr>
      <td class="federationhealth-router-icon federationhealth-router-{iconState}" title="{title}"></td>
      <td>{address}</td>
      <td>{status}</td>
      <td>{lastHeartbeat} sec ago</td>
      <td>{lastMembershipUpdate}</td>
      <td>{lastMountTableUpdate}</td>
      <td>{version}</td>
    </tr>
    {/Routers}
  </tbody>
</table>
</script>

<!-- Datanodes -->
<script type="text/x-dust-template" id="tmpl-datanode">
<div class="page-header"><h1>Datanode Information</h1></div>
<div>
  <ul class="dfshealth-node-legend">
    <li class="dfshealth-node-icon dfshealth-node-alive">In service</li>
    <li class="dfshealth-node-icon dfshealth-node-down">Down</li>
    <li class="dfshealth-node-icon dfshealth-node-decommissioned">Decommissioned</li>
    <li class="dfshealth-node-icon dfshealth-node-down-decommissioned">Decommissioned &amp; dead</li>
  </ul>
</div>
<div class="page-header"><h1><small>In operation</small></h1></div>
<small>
<table class="table" id="table-datanodes">
  <thead>
    <tr>
      <th>Node</th>
      <th>Last contact</th>
      <th style="width:180px; text-align:center">Capacity</th>
      <!--th>Blocks</th-->
      <th>Block pool used</th>
      <!--th>Version</th-->
    </tr>
  </thead>
  {#LiveNodes}
  <tr>
    <td ng-value="{state}-{name}" class="dfshealth-node-icon dfshealth-node-{state}">{location}/{name} ({xferaddr})</td>
    <td ng-value="{lastContact}">{#helper_relative_time value="{lastContact}"/}</td>
    <td ng-value="{usedPercentage}" style="width:210px">
      <div>
        <div style="display:inline-block; float: left; padding-right: 10px; width:60px;">{capacity|fmt_bytes}</div>
        <div class="clearfix progress dfshealth-node-capacity-bar" title="Non DFS: {nonDfsUsedSpace|fmt_bytes}, Used: {used|fmt_bytes}">
          <div class="progress-bar {#helper_usage_bar value="{usedPercentage}"/}" style="width: {usedPercentage}%">
          </div>
        </div>
      </div>
    </td>
    <!--td>{numBlocks}</td-->
    <td ng-value="{blockPoolUsedPercent}">{blockPoolUsed|fmt_bytes} ({blockPoolUsedPercent|fmt_percentage})</td>
    <!--td>{version}</td-->
  </tr>
  {/LiveNodes}
  {#DeadNodes}
  <tr class="danger">
    <td ng-value="{state}-{name}" class="dfshealth-node-icon dfshealth-node-{state}">{location}/{name} ({xferaddr})</td>
    <td>{#helper_relative_time value="{lastContact}"/}</td>
    <td></td>
    <!--td></td-->
    <td></td>
    <!--td></td-->
  </tr>
  {/DeadNodes}
</table>
</small>

<div class="page-header"><h1><small>Decommissioning</small></h1></div>
<small>
<table class="table">
  <thead>
    <tr>
      <th>Node</th>
      <th>Under replicated blocks</th>
      <th>Blocks with no live replicas</th>
      <th>Under Replicated Blocks <br/>In files under construction</th>
    </tr>
  </thead>
  {#DecomNodes}
  <tr>
    <td>{location}/{name} ({xferaddr})</td>
    <td>{underReplicatedBlocks}</td>
    <td>{decommissionOnlyReplicas}</td>
    <td>{underReplicateInOpenFiles}</td>
  </tr>
  {/DecomNodes}
</table>
</small>
</script>

<!-- Mount table -->
<script type="text/x-dust-template" id="tmpl-mounttable">
<div class="page-header"><h1>Mount Table</h1></div>
<small>
<table class="table">
  <thead>
    <tr>
      <th>Global path</th>
      <th>Target nameservice</th>
      <th>Target path</th>
      <th>Order</th>
      <th>Read only</th>
      <th>Owner</th>
      <th>Group</th>
      <th>Permission</th>
      <th>Quota/Usage</th>
      <th>Date Modified</th>
      <th>Date Created</th>
    </tr>
  </thead>
  <tbody>
    {#MountTable}
    <tr>
      <td>{sourcePath}</td>
      <td>{nameserviceId}</td>
      <td>{path}</td>
      <td>{order}</td>
      <td class="mount-table-icon mount-table-read-only-{readonly}"/>
      <td>{ownerName}</td>
      <td>{groupName}</td>
      <td>{mode}</td>
      <td>{quota}</td>
      <td>{dateModified}</td>
      <td>{dateCreated}</td>
    </tr>
    {/MountTable}
  </tbody>
</table>
</small>
</script>



<script type="text/javascript" src="/static/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="/static/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="/static/bootstrap-3.3.7/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/static/dataTables.bootstrap.js"></script>
<script type="text/javascript" src="/static/moment.min.js"></script>
<script type="text/javascript" src="/static/dust-full-2.0.0.min.js"></script>
<script type="text/javascript" src="/static/dust-helpers-1.1.1.min.js"></script>
<script type="text/javascript" src="/static/dfs-dust.js"></script>
<script type="text/javascript" src="federationhealth.js"></script>
</body>
</html>
